var $ = require('../../common/helper.js');
Page({
	data: {
		flashes: [],
		grids: [],
		articles: []
	},
	onLoad: function (options) {
		var _this = this;
		$.get('api.php?app=home&act=index', function (json) {
			_this.setData({
				flashes: json.data.flashes,
				grids: json.data.grids,
				articles: json.data.articles
			});
		});
	},
	call: function (e) {
		var data = e.currentTarget.dataset;
		wx.makePhoneCall({
			phoneNumber: data.tel
		});
	},
	onShareAppMessage: function (res) {
		return {
			title: $.config.shareTitle,
			imageUrl: $.config.shareImageUrl,
			path: this.route
		}
	}
})